﻿@model Marbale.BusinessObject.SiteSetup.User
@{
    ViewBag.Title = "Login";
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>

    <!-- Bootstrap CSS CDN -->
    <link rel="stylesheet" href="~/Content/CSS/bootstrap.css">
    <!-- Our Custom CSS -->
    <link rel="stylesheet" href="~/Content/CSS/style.css">
    <link rel="stylesheet" href="~/Content/CSS/layout.css">

    <script src="~/Scripts/jquery-3.3.1.min.js"></script>
    <script src="~/Content/JS/bootstrap.min.js"></script>

    <script src="~/Content/JS/popper.min.js"></script>
    <script defer src="~/Content/JS/fontawesome.solid.js"></script>
    <script defer src="~/Content/JS/fontawesome.js"></script>

    @Scripts.Render("~/bundles/modernizr")
</head>
<body>

    <div class="wrapper">

        <!-- Page Content  -->
        <div id="Content">

            <nav class="navbar navbar-expand-lg navbar-light bg-light">
                <div class="container-fluid">
                    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                        <div>
                            @using (Ajax.BeginForm("Login", "Marble", FormMethod.Post, new AjaxOptions { OnSuccess = "displayMessage" }))
                            {  
                                <fieldset>
                                    @Html.AntiForgeryToken()
                                    @Html.ValidationSummary("", new { @class = "text-danger" })
                                    @if (@ViewBag.Message != null)
                                    {  
                                        <div style="border: 1px solid red">
                                            @ViewBag.Message
                                        </div>  
                                    }
                                    @Html.HiddenFor(model => model.Name,
                                            new { id = "Name", Value = "marbale" })
                                    <label>UserId</label>
                                    @Html.TextBoxFor(a => a.LoginId)

                                    <label>Password</label>
                                    @Html.TextBoxFor(a => a.Password, new { Type = "password" })

                                    <button class="btn btn-primary btn-md" style="margin-left: 20px" role="button" type="submit">Login</button>
                                </fieldset>  
                            }
                        </div>

                    </div>
                </div>
            </nav>
        </div>
        <img src="~/Content/Images/marbleHome.jpeg" alt="Marble" class="center">
    </div>
    <script type="text/javascript">
        function displayMessage(response) {
            $('#message').innerHTML = response;
        }
    </script>

</body>
</html>
